﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ServerMonitor
{
    public class SnmpBean
    {
        private string ipAddress;
        private string usedMemoryCommand;
        private string freeMemoryCommand;
        private string cpuLoadCommand;
        private string temperatureCommand;
        private string trapString;
        private string deviceName;
        private long reslutTotalMemory;
        private long resultAvailableMemory;
        private int resultCpuLoad;
        private int resultMemoryUsage;
        private int resultTemperature;
        private string[] oids;
        private bool isConnected;
        private int portCount;
        private int[] portStatus;
        private string updateTime;

        public string IpAddress
        {
            get
            {
                return ipAddress;
            }

            set
            {
                ipAddress = value;
            }
        }

        [JsonIgnore]
        public string UsedMemoryCommand
        {
            get
            {
                return usedMemoryCommand;
            }

            set
            {
                usedMemoryCommand = value;
            }
        }

        [JsonIgnore]
        public string FreeMemoryCommand
        {
            get
            {
                return freeMemoryCommand;
            }

            set
            {
                freeMemoryCommand = value;
            }
        }

        [JsonIgnore]
        public string CpuLoadCommand
        {
            get
            {
                return cpuLoadCommand;
            }

            set
            {
                cpuLoadCommand = value;
            }
        }

        [JsonIgnore]
        public string TemperatureCommand
        {
            get
            {
                return temperatureCommand;
            }

            set
            {
                temperatureCommand = value;
            }
        }

        [JsonIgnore]
        public string TrapString
        {
            get
            {
                return trapString;
            }

            set
            {
                trapString = value;
            }
        }

        public string DeviceName
        {
            get
            {
                return deviceName;
            }

            set
            {
                deviceName = value;
            }
        }

        public long ReslutTotalMemory
        {
            get
            {
                return reslutTotalMemory;
            }

            set
            {
                reslutTotalMemory = value;
            }
        }

        public long ResultAvailableMemory
        {
            get
            {
                return resultAvailableMemory;
            }

            set
            {
                resultAvailableMemory = value;
            }
        }

        public int ResultCpuLoad
        {
            get
            {
                return resultCpuLoad;
            }

            set
            {
                resultCpuLoad = value;
            }
        }

        public int ResultMemoryUsage
        {
            get
            {
                return resultMemoryUsage;
            }

            set
            {
                resultMemoryUsage = value;
            }
        }

        public int ResultTemperature
        {
            get
            {
                return resultTemperature;
            }

            set
            {
                resultTemperature = value;
            }
        }

        [JsonIgnore]
        public string[] Oids
        {
            get
            {
                if (oids == null || oids.Length < 0)
                {
                    oids = new string[4];
                    oids[0] = usedMemoryCommand;
                    oids[1] = freeMemoryCommand;
                    oids[2] = cpuLoadCommand;
                    oids[3] = temperatureCommand;
                }
                return oids;
            }

            set
            {
                oids = value;
            }
        }

        public bool IsConnected
        {
            get
            {
                return isConnected;
            }

            set
            {
                isConnected = value;
            }
        }

        public string UpdateTime
        {
            get
            {
                return updateTime;
            }

            set
            {
                updateTime = value;
            }
        }

        public int[] PortStatus
        {
            get
            {
                return portStatus;
            }

            set
            {
                portStatus = value;
            }
        }

        public int PortCount
        {
            get
            {
                return portCount;
            }

            set
            {
                portCount = value;
            }
        }
    }
}
